package com.example.building_material_mannager.service.impl;

import com.example.building_material_mannager.entity.Customer;
import com.example.building_material_mannager.mapper.CustomerMapper;
import com.example.building_material_mannager.service.CustomerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Resource
    CustomerMapper customerMapper;

    @Override
    public List<Customer> showCustomer(Customer customer) {
        List<Customer> customers = customerMapper.showCustomer(customer);
        return  customers;
    }

    @Override
    public boolean addCustomer(Customer customer) {
        boolean re=customerMapper.addCustomer(customer);
        return re;
    }

    @Override
    public boolean delCustomer(Integer cid) {
        boolean re=customerMapper.delCustomer(cid);
        return re;
    }

    @Override
    public boolean upCustomer(Customer customer) {
        System.out.println(customer.getCcom());
        boolean re=customerMapper.upCustomer(customer);
        return re;
    }
}
